<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="repository.PropertyScrapDAO"
	import="java.sql.ResultSet"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	if (session.getAttribute("loginUser") == null) {
		response.sendRedirect("NoLogin.jsp");
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>资产管理平台</title>
</head>
<body>
	<jsp:include page="Header.jsp" />
	<div class="container">
		<div class="title">
			<h4>总资产表</h4>
			<div class="table-responsive">
			</div>
				<table class="table table-striped">
					<thead>
						<tr>
							<th>物品ID</th>
							<th>物品名称</th>
							<th>物品价格</th>
							<th>所属学院</th>
							<th>使用状况</th>
							<th>数量</th>
							<c:choose>
								<c:when test="${sessionScope.identity=='管理员'}">
									<th>删除</th>
									<th>修改</th>
								</c:when>
								<c:otherwise></c:otherwise>
							</c:choose>
						</tr>
					</thead>
					<tbody>
						<c:forEach var="user" items="${ requestScope.propertySco }">
							<tr>
								<td>${user.ID }</td>
								<td>${user.name }</td>
								<td>${user.price }</td>
								<td>${user.location }</td>
								<td>${user.use }</td>
								<td>${user.number }</td>
								<c:choose>
									<c:when test="${sessionScope.identity=='管理员'}">
										<td><a href="deleteAll.jsp?ID=${user.ID }">删除</a></td>
										<td><a href="AllPropMod.jsp?ID=${user.ID }">修改</a></td>
									</c:when>
									<c:otherwise></c:otherwise>
								</c:choose>
							</tr>
						</c:forEach>
					</tbody>
				</table>
				<c:choose>
					<c:when test="${sessionScope.identity=='管理员'}">
						<button type="submit" class="btn">
							<a href="AllPropInc.jsp">添加</a>
						</button>
					</c:when>
					<c:otherwise></c:otherwise>
				</c:choose>

			</div>
		</div>
		<script type='text/javascript' src="js/jquery-1.9.1.min.js"></script>
		<script type='text/javascript' src="js/bootstrap.min.js"></script>
</body>
<style>
h4 {
	color: white;
	font-size: 30px;
	line-height: 150px;
	width: 100%;
	background: radial-gradient(circle, #33cccc, blue);
	text-align: center;
	margin-bottom: 2px;
	border-bottom: 2px solid darkblue;
}

.table-responsive {
	padding: 0;
}

body {
	width: 100%;
	background-image: url(./img/table-color.jpg);
}
</style>
</html>